package _designPatterm.备忘录模式;

public class Client {
    public static void main(String[] args) {

        Originator originator = new Originator();
        Caretaker catetaker = new Caretaker();
        originator.setState("状态1,攻击力100");

        catetaker.add(originator.saveMemento());

        originator.setState("状态2,攻击力80");
        catetaker.add(originator.saveMemento());


        System.out.println("当前的状态是:" + originator.getState());
        //恢复到状态1
        originator.getStateFromMemento(catetaker.get(0));
        System.out.println("恢复后:" + originator.getState());

    }
}
